package com.axxy.strategy;

/**
 * @author 一缕茜阳
 * @date 2021/7/12
 */
public class Test {
    public static void main(String[] args) {
        RedAndCanFlyBird redBird = new RedAndCanFlyBird();
        redBird.setFly(new Fly() {
            @Override
            public void fly() {
                System.out.println("I can Fly");
            }
        });
        redBird.setDisplay(new Display() {
            @Override
            public void show() {
                System.out.println("red");
            }
        });
        redBird.perform();
        redBird.setFly(new Fly() {
            @Override
            public void fly() {
                System.out.println("我又不会飞了");
            }
        });
        redBird.perform();
    }
}
